package model.macro
{
	import model.micro.projectiles.ProjectileType;
	import util.Settings;
	
	/**
	 *
	 */
	public class RangedWeapon extends Weapon
	{	
		public static const LONGBOW:RangedWeapon = new RangedWeapon("Long Bow", 2, 2, 2, ProjectileType.ARROW, 3, 50, 2);
		public static const CROSSBOW:RangedWeapon = new RangedWeapon("CrossBow", 2, 2, 2, ProjectileType.BOLT, 10, 40, 3);
		
		/**The type of projectile fired.*/
		private var _projectile_type:ProjectileType;
		/**In seconds.*/
		private var _reload_time:Number;
		/**In pixels per frame.*/
		private var _release_velocity:Number;
		
		/**
		 * Create a new ranged weapon.
		 * @param	name
		 * @param	melee_range
		 * @param	melee_damage
		 * @param	weight
		 * @param	projectile_type
		 * @param	reload_time
		 * @param	release_velocity
		 */
		public function RangedWeapon(name:String, melee_range:int, melee_damage:int, weight:int, projectile_type:ProjectileType, reload_time:Number, release_velocity:Number, cost:int)
		{
			super(name, melee_range, melee_damage, weight, cost);
			_reload_time = reload_time;
			_projectile_type = projectile_type;
			_release_velocity = release_velocity * Settings.METER;
		}
		
		public function get projectile_type():ProjectileType
		{
			return _projectile_type;
		}
		
		public function get release_velocity():Number 
		{
			return _release_velocity;
		}
		
		public function get reload_time():Number 
		{
			return _reload_time;
		}
	}

}